package com.cragon.synthetic;

import java.lang.reflect.Constructor;
import java.lang.reflect.Method;
import java.lang.reflect.Parameter;

public class SyntheticTest {
	public void test() {
		// Java的语法规则中是无法直接使用私有构造方法创建对象的
		SyntheticInnerTest test = new SyntheticInnerTest();
		System.out.println(test.i);
	}

	class SyntheticInnerTest {
		// 存在私有的构造方法
		private SyntheticInnerTest() {

		}
		private int i;
	}

	public static void main(String[] args) {
		/*for (Method method : SyntheticInnerTest.class.getDeclaredMethods()) {
			System.out.println(method.getName());
		}*/
		int i = 1;
		for (Constructor<?> constructor : SyntheticInnerTest.class.getDeclaredConstructors()) {
			System.out.println("------------" + i++);
			for (Parameter parameter : constructor.getParameters()) {
				System.out.println(parameter.getType());
			}
		}
	}
}
